package com.zl.task.util.resp;

import lombok.ToString;

/**
 * @author YinlinGeng
 */

@ToString
public enum RespCode {

    //http 相关
    SUCCESS(0, "操作成功"),
    FAIL(1, "错误请求"),
    UNAUTHORIZED(1, "未授权"),
    FORBID(1, "该状态不允许操作"),
    NOT_FOUND_404(1, "未找到"),
    REQUEST_TIMEOUT(1, "请求超时"),
    SERVER_INTERNAL_ERROR(1, "服务器内部错误"),
    SERVICE_UNAVAILABILITY(1, "系统异常,请稍后再试"),
    HTTP_PARAMS_ERROR(1, "请求参数错误"),
    HTTP_METHOD_ERROR(1, "请求方法错误"),

    //全局相关的
    REPEAT_SUBMIT_ERROR(1, "您请求太快了，请稍后再试"),
    SYS_RESOURCE_DELETE_ERROR(1, "系统资源，不能删除"),
    SYS_CONFIG_NO_ERROR(1, "暂无配置信息，请先配置相关信息"),
    IS_CONTAIN_CHINESE(1, "规格包含中文");

    RespCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private int code;
    private String msg;

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}